package com.example.demo;

import org.springframework.http.HttpRequest;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
//@RestController
//@RequestMapping("/user")
//public class HelloSevert2 {
//    @RequestMapping("/login")
//    public Boolean login(String userName,String password,HttpSession session){
////       if(!StringUtils.hasLength(userName)||!StringUtils.hasLength(password)){
////           return false;
////       }
//        if(userName==null||userName.length()==0||password==null||userName.length()==0){
//            return false;
//        }
//       if("admin".equals(userName)&&"admin".equals(password)){
//           session.setAttribute("username","admin");
//           return true;
//       }
//       return true;
//    }
//    @RequestMapping("getUserInfo")
//    public String getUserHr(HttpServletRequest request){
//        HttpSession session = request.getSession();
//        String userName=null;
//        if(session!=null){
//            userName = (String)session.getAttribute("username");
//        }
//        return userName;
//    }
//}
